package ai.tuobot.sdk

import ai.tuobot.sdk.model.Character
import ai.tuobot.sdk.model.EventType
import ai.tuobot.sdk.model.TTSCmd
import ai.tuobot.sdk.model.TuobotEvent
import ai.tuobot.sdk.network.ApiExt
import ai.tuobot.sdk.network.ConfigApi
import ai.tuobot.sdk.util.StringUtil
import android.util.Log
import okhttp3.internal.trimSubstring
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject
import org.junit.Test

import org.junit.Assert.*
import org.junit.runner.RunWith
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {

    @Test
    fun addition_isCorrect() {
        assertEquals(4, 2 + 2)
    }


    @Test
    fun ttsTest(){
        val character = Character(id = "1", character_id = "1001", language = "English")
        val ttsCmd = TTSCmd(character, "to tts text")

        val sendJson = ttsCmd.getNeedFormatedJsonStr()

        val comParedSendJson = "{\"tts\":{" +
                "\"character\": {\"id\": \"1\", \"character_id\": \"1001\", \"language\": \"English\"}," +
                "\"text\":\"to tts text\""+
                "}}"

        assertEquals(sendJson,comParedSendJson)
    }

}